require "logUtil"
require "util"


setting = {}

setting.run = false  -- 是否运行脚本
setting.runType = -1; -- 运行方式
setting.runType_ZiChan = 0; -- 运行方式
setting.runType_GuanQia = 1; -- 运行方式
setting.runType_FuDi = 2; -- 运行方式


init("0", 0); --以当前应用 Home 键在右边初始化
setScreenScale(1080, 1920)    --在540*960分辨率的手机中开发了脚本，要在720*1280的设备中运行 -


function showSettingUi()
    ret, results = showUI("ui.json");
    -- 是否运行 脚本
    if ret == 1 then
        setting.run = true;
    end

    -- 运行方式
    if not (string.find(results.runType, "0", 0) == nil) then
        setting.runType = setting.runType_ZiChan
    end
    if not (string.find(results.runType, "1", 0) == nil) then
        setting.runType = setting.runType_GuanQia
    end
    if not (string.find(results.runType, "2", 0) == nil) then
        setting.runType = setting.runType_FuDi
    end

end  
